<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>

<html>
       <f:view>
          <head>
             <title>
                <h:outputText value="#{rentaBike.storeName}"/>
             </title>
          </head>

          <body>
             <h1><h:outputText value="Edit Bike"/></h1>

             <h:form id="editForm">
                <h:panelGrid columns="2">
                   <h:outputText value="Manufacturer:"/>
                   <h:panelGroup>
                      <h:inputText id="manufacturer" 
                         value="#{editBikeController.bikeToEdit.manufacturer}"/>
                      <h:message for="manufacturer" style="color: Red"/>
                   </h:panelGroup>
                   <h:outputText value="Model:"/>
                   <h:panelGroup>
                      <h:inputText id="model" 
                                value="#{editBikeController.bikeToEdit.model}"/>
                      <h:message for="model" style="color: Red"/>
                   </h:panelGroup>

                   <h:outputText value="Frame:"/>
                   <h:panelGroup>
                      <h:inputText id="frame" 
                                value="#{editBikeController.bikeToEdit.frame}"
                            converter="javax.faces.Integer"/>
                      <h:message for="frame" style="color: Red"/>
                   </h:panelGroup>

                   <h:outputText value="Serial Number:"/>
                   <h:panelGroup>
                      <h:inputText id="serialNo"
                             value="#{editBikeController.bikeToEdit.serialNo}"/>
                      <h:message for="serialNo" style="color: Red"/>
                   </h:panelGroup>

                   <h:outputText value="Weight:"/>
                   <h:panelGroup>
                      <h:inputText id="weight" 
                                value="#{editBikeController.bikeToEdit.weight}"
                            converter="javax.faces.Double"/>
                      <h:message for="weight" style="color: Red"/>
                   </h:panelGroup>

                   <h:outputText value="Status:"/>
                   <h:panelGroup>
                      <h:inputText id="status" 
                               value="#{editBikeController.bikeToEdit.status}"/>
                      <h:message for="status" style="color: Red"/>
                   </h:panelGroup>
                </h:panelGrid>

                <h:outputText value="<br/><br/>" escape="false"/>

                <h:commandButton value="Submit"
                action="#{editBikeController.saveBike}"/>
             </h:form>
          </body>
       </f:view>
    </html>